
(import
  (scheme base)
  (scheme write)
  (srfi 64)
  (scheme load))

(load "./solution.scm")

(define test-values
  '(("Example 1" ("babad") "bab") ;; aba is also acceptable
    ("Example 2" ("cbbd") "bb")))

(define (test-solution proc)
  (test-begin "Problem 5 Test Suite")
  (for-each (lambda (test-pair)
              (define name (list-ref test-pair 0))
              (define input (list-ref test-pair 1))
              (define output (list-ref test-pair 2))
              (define actual-output (apply proc input))
              (test-equal name output actual-output))
            test-values)
  (test-end))

(test-solution solution5)
